🎖️GitЯра🎖️
CONTRIBUTING.md renovate/actions-setup-java-5.x (f17e586c) Text, 4.86 KB
Tc9d1d9# Contributing to Meshtastic-Android
Thank you for your interest in contributing to Meshtastic-Android! We welcome contributions from everyone. Please take a moment to review these guidelines to help us maintain a high-quality, collaborative project.
Tc9d1d9## How to Contribute
Tff7b72- **Fork the repository** and create your branch from Ta5d6ff`main` or the appropriate feature branch.
Tff7b72- **Make your changes** in a logical, atomic manner.
Tff7b72- **Test your changes** thoroughly before submitting a pull request.
Tff7b72- **Submit a pull request** (PR) with a clear description of your changes and the problem they solve.
Tff7b72- If you are addressing an existing issue, please reference it in your PR (e.g., Ta5d6ff`Fixes #123`).
Tc9d1d9## Code Style
Tff7b72- Follow the [Tff7b72Kotlin Coding Conventions](Te6edf3https://kotlinlang.org/docs/coding-conventions.html) for Kotlin code.
Tff7b72- Use Android Studio's default formatting settings.
Tff7b72- We use [Tff7b72spotless](Te6edf3https://github.com/diffplug/spotless) for automated code formatting. You can run Ta5d6ff`./gradlew spotlessApply` to format your code automatically.
Tff7b72- You can also run Ta5d6ff`./gradlew spotlessInstallGitPrePushHook --no-configuration-cache` to install a pre-push Git hook that will run a Ta5d6ff`spotlessCheck`.
Tff7b72- Write clear, descriptive variable and function names.
Tff7b72- Add comments where necessary, especially for complex logic.
Tff7b72- Keep methods and classes focused and concise.
Tff7b72- **Strings:** Use localised strings via the **Compose Multiplatform Resource** library in Ta5d6ff`:core:resources`.
Tff7b72- Do **not** use the legacy Ta5d6ff`androidApp/src/main/res/values/strings.xml`.
Tff7b72- **Definition:** Add strings to Ta5d6ff`core/resources/src/commonMain/composeResources/values/strings.xml`.
Tff7b72- **Usage:**
Ta5d6ff ```Ta5d6ffkotlin
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.your_string_key
Te6edf3TextTb4b4b4(Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3your_string_keyTb4b4b4)Tb4b4b4)
Ta5d6ff ```
Tc9d1d9### Linting
Meshtastic-Android uses [Tff7b72Detekt](Te6edf3https://detekt.dev/) for static code analysis and linting of Kotlin code.
Tff7b72- Run Ta5d6ff`./gradlew detekt` before submitting your pull request to ensure your code passes all lint checks.
Tff7b72- Fix any Detekt warnings or errors reported in your code.
Tff7b72- It is possible to suppress warnings individually, but this should be used very sparingly.
Tff7b72- You can find Detekt configuration in the Ta5d6ff`config/detekt` directory. If you believe a rule should be changed or suppressed, discuss it in your PR.
Consistent linting helps keep the codebase clean and maintainable.
Tc9d1d9### Testing
Meshtastic-Android uses unit tests, Robolectric JVM tests, and instrumented UI tests to ensure code quality and reliability.
Tff7b72- **Unit tests** are located in the Ta5d6ff`src/test/` directory of each module.
Tff7b72- **Compose UI Tests (JVM)** are preferred for component testing and are also located in Ta5d6ff`src/test/` using **Robolectric**.
Tff7b72- Note: If using Java 21, pin your Robolectric tests to Ta5d6ff`@Config(sdk = [34])` to avoid SDK 35 compatibility issues.
Tff7b72- **Instrumented tests** (including full E2E UI tests) are located in Ta5d6ff`src/androidTest/`. For Compose UI, use the [Tff7b72Jetpack Compose Testing APIs](Te6edf3https://developer.android.com/jetpack/compose/testing).
Tc9d1d9#### Guidelines for Testing
Tff7b72- Add or update tests for any new features or bug fixes.
Tff7b72- Ensure all tests pass by running:
Tff7b72- Ta5d6ff`./gradlew test` for unit and Robolectric tests
Tff7b72- Ta5d6ff`./gradlew connectedAndroidTest` for instrumented tests
Tff7b72- For UI components, write Robolectric Compose tests where possible for faster execution.
Tff7b72- If your change is difficult to test, explain why in your pull request.
Comprehensive testing helps prevent regressions and ensures a stable experience for all users.
Tc9d1d9## Pull Requests
Tff7b72- branches should start with:
Tff7b72- bugfix
Tff7b72- enhancement
Tff7b72- dependencies
Tff7b72- repo
Tff7b72- reserved (release, automation)
Tff7b72- Ensure your branch is up to date with the latest Ta5d6ff`main` branch before submitting a PR.
Tff7b72- Provide a meaningful title and description for your PR.
Tff7b72- Include information on how to test and/or replicate if it is not obvious.
Tff7b72- Include screenshots or logs if your change affects the UI or user experience.
Tff7b72- Be responsive to feedback and make requested changes promptly.
Tff7b72- Squash commits if requested by a maintainer.
Tc9d1d9## Issue Reporting
Tff7b72- Search existing issues before opening a new one to avoid duplicates.
Tff7b72- Provide a clear and descriptive title.
Tff7b72- Include steps to reproduce, expected behavior, and actual behavior.
Tff7b72- Attach logs, screenshots, or other helpful context if applicable.
Tc9d1d9## Community Standards
Tff7b72- Be respectful and considerate in all interactions.
Tff7b72- The Meshtastic Android project is subject to the code of conduct for the parent project, which can be [Tff7b72found here:](Te6edf3https://meshtastic.org/docs/legal/conduct/)
Tff7b72- Help others by reviewing pull requests and answering questions when possible.
Thank you for helping make Meshtastic-Android better!
Served by rngit 1.5.0 - Generated in 0.15s